package logic

import (
	"context"
	"video-hub/models/mysql"

	"video-hub/videorpc/internal/svc"
	"video-hub/videorpc/videorpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type DelCollectLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewDelCollectLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DelCollectLogic {
	return &DelCollectLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *DelCollectLogic) DelCollect(in *videorpc.DelCollectRequest) (*videorpc.DelCollectResponse, error) {
	// todo: add your logic here and delete this line
	var collect mysql.Collection

	if err := collect.DelCOl(mysql.DB, in.CollectionId); err != nil {
		return nil, err
	}
	return &videorpc.DelCollectResponse{}, nil
}
